package edu.clemson.wcbeck.cft;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class CFTMyPhotos extends Activity{

    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_photos);   
        
        Context contextActivity; PackageManager pm; 
        contextActivity = this; pm = contextActivity.getPackageManager();
        
        
        if (pm.hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
    		boolean hasCamera = true;
    		String action = null;
    		int actionCode = 0;
    		
    		isIntentAvailable(contextActivity, action);
    		dispatchTakePictureIntent(actionCode);
    	}
    }
	
    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        MenuInflater inflater = getMenuInflater();
        inflater.inflate(R.menu.aboutmenu, menu);
        return true;
    }
    
    public void initMain(){
    	Intent intent = new Intent();
        setResult(RESULT_OK, intent);
        finish();
    }
    
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
            case R.id.icFavorites: //initAbout();
                                break;
            case R.id.icBack: initMain();
            					break;
            //case R.id.icExit: initExit();
            //					break;
        }
        return true;
    }
}

